package com.xdh.springcloud.producer.postgresql.service.impl;

import com.xdh.springcloud.producer.postgresql.service.PostgresqlServiceRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class PostgresqlServiceImpl implements PostgresqlServiceRemote {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List queryForList(String sql) {
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}
